package com.example.teaching_server.config;

import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.info.Info;
import io.swagger.v3.oas.models.info.Contact;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * SpringDoc OpenAPI配置类
 * 配置API文档生成规则和访问路径
 * 访问地址: http://localhost:8080/swagger-ui/index.html
 */
@Configuration
public class SwaggerConfig {

    /**
     * 配置OpenAPI信息
     *
     * @return OpenAPI对象
     */
    @Bean
    public OpenAPI customOpenAPI() {
        return new OpenAPI()
                .info(new Info()
                        .title("教学服务平台API文档")
                        .description("教学服务平台后端接口文档")
                        .version("v1.0.0")
                        .contact(new Contact()
                                .name("开发团队")
                                .email("dev@example.com")));
    }
}
